<%--
 *  File:    PublicationNotesSummary.jsp
 *  @Author: Vector Mao
 *  Date:    2/18/2002 14:45
 *
 *  Copyright (C) 2000 - 2002 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  	//init param
	Category cat = Category.getInstance("jsp.PublicationNotesSummary");
	String privilegeCode = "Z0402,L301";
  	String strModuleName = "BIEE";
  	String strClassType = "";
%>



<%
  	HashMap userInfo = (HashMap)session.getAttribute("userinfo");
  	
%>

<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<html>
<head>
<title>PublicationNotesSummary</title>
<PageFlow:CheckPageFlow pageName="publicationnotessummary"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../css/<%= strLanguageCode %>/script.js">
</script>
<script language="JavaScript" src="../js/FuncLib.js">
</script>
<script>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(publicationnotessummaryform,actionvalue,orderbyname);
  editform.action = "PublicationNotesSummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function clickIt(id, status)
{
  document.publicationnotessummaryform.currentid.value = id;
  document.publicationnotessummaryform.currentstatus.value = status;
  parent.down.location.href = "../common/Blank.jsp?<%= OvalTools.randomURL() %>";
}
function page_stop()
{
        var id = document.publicationnotessummaryform.currentid.value;
  	if(id == null || id.length == 0 || id == "" || id == "-1")
  	  return;
        var status = document.publicationnotessummaryform.currentstatus.value;
  	if((parseInt(status)!=20) && (parseInt(status)!=40))
  	{
  	  alert("<%= message.getMessageDesc("J_CANT_CANCEL") %>");
  	  return;
  	}
  	var flag = confirm("<%= message.getMessageDesc("ARE_YOU_SURE_STOP") %>");
  	if(!flag)
    	  return;
  	document.publicationnotessummaryform.notesid.value = id;
  	document.publicationnotessummaryform.actionname.value = "stop";
  	document.publicationnotessummaryform.target = "_parent";
  	isRunning = true;
  	document.publicationnotessummaryform.submit();
}
function page_delete()
{
	  var id = document.publicationnotessummaryform.currentid.value;
  	if(id == null || id.length == 0 || id == "" || id == "-1")
  	  return;
	  var status = document.publicationnotessummaryform.currentstatus.value;
  	if(parseInt(status)>10)
  	{
  	  alert("<%= message.getMessageDesc("CAN_NOT_DEL_IT") %>");
  	  return;
  	}
  	var flag = confirm("<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>");
  	if(!flag)
    	return;
  	document.publicationnotessummaryform.notesid.value = id;
  	document.publicationnotessummaryform.actionname.value = "delete";
  	document.publicationnotessummaryform.target = "_parent";
  	isRunning = true;
  	document.publicationnotessummaryform.submit();
}
function page_edit()
{
  	var id1 = document.publicationnotessummaryform.currentid.value;
  	if(id1 == null || id1.length == 0 || id1 == "" || id1 == "-1")
  	{
    	return;
  	}
	  var status = document.publicationnotessummaryform.currentstatus.value;
  	if(parseInt(status)>10)
  	{
  	  alert("<%= message.getMessageDesc("CAN_NOT_EDIT_IT") %>");
  	  return;
  	}
  	var link = "NotesEdit.jsp?<%= OvalTools.randomURL() %>&subjectcode=202&orgid=<%=JspHelper.filterNull( userInfo.get("orgid"))%>&notesid=" + id1 + "&languagecode=" + "<%= strLanguageCode %>";
  	parent.down.location.href = link;
}
function page_new()
{
	var link = "NotesEdit.jsp?<%= OvalTools.randomURL() %>&subjectcode=202&orgid=<%=JspHelper.filterNull( userInfo.get("orgid"))%>&languagecode=" + "<%= strLanguageCode %>";
  	parent.down.location.href = link;
}
</script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%--------------------------------------  output variant from pageflow   --%>
<%
	Vector publicationnotessummary = (Vector)pageContext.getAttribute("publicationnotessummary");
  	if(publicationnotessummary == null)
    	publicationnotessummary = new Vector();
%>
</head>
<body>
	
	<%--------------------------------------  hidden form variant   --%>
	<form name="publicationnotessummaryform" method="post" action="../Dispatcher">
    <input type="hidden" name="pagename" value="publicationnotessummary">
    <input type="hidden" name="actionname">
    <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    <input type="hidden" name="notesid">
	
	<%--------------------------------------  page location   --%>
	<%@ include file="/inc/PageLocation.inc" %>

	
	<table width="100%" cellspacing="0" border="0" cellpadding="0">
  	<tr>
    	<td>
      		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        <tr class="deepblue-left"> 
            	<td class="title_center" width="30">&nbsp;</td>
            	<td class="title_center" width="400"><a href="javascript:page_summary('orderby','title')"><%= label.getLabelName("L_Title") %></a></td>
            	<td class="title_center" width="70"><a href="javascript:page_summary('orderby','fromusername')"><%= label.getLabelName("L_Resource") %></a></td>
            	<td width="70" class="title_center"><a href="javascript:page_summary('orderby','begindate')"><%= label.getLabelName("L_BuildDate") %></a></td>
            	<td width="60" class="title_center"><a href="javascript:page_summary('orderby','enddate')"><%= label.getLabelName("L_ExpireDate") %></a></td>
            	<td width="40" class="title_center"><a href="javascript:page_summary('orderby','statusname')"><%= label.getLabelName("L_Status") %></a></td>
          	</tr>
          	<%--------------------------------------  default value definition   --%>
          	<%
            	Integer nDefaultId = new Integer(-1);
            	Integer nDefaultStatus = new Integer(-1);
          	%>

  			<%--------------------------------------  loop results   --%>
          	<logic:iterate id="ps" collection="<%= publicationnotessummary %>" indexId="orderId">
          	<%
            	HashMap psMap = (HashMap)ps;
            	String strIsChecked = new String("");

            	if((orderId.intValue())%2 == 1)
            	{
              		strClassType = "td-listrom";
            	}else{
              		strClassType = "none";
            	}
            	if(orderId.intValue()==0)
            	{
              		strIsChecked = "Checked";
              		nDefaultId = (Integer)(psMap.get("notesid"));
              		nDefaultStatus = (Integer)(psMap.get("status"));
            	}
           	%>
          	<tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"  onClick="javascript:radiotrue('radio<%=JspHelper.filterNull( orderId )%>');clickIt('<%=JspHelper.filterNull( psMap.get("notesid") )%>', '<%=JspHelper.filterNull( psMap.get("status") )%>');" class="<%=JspHelper.filterNull( strClassType )%>">
            	<td height="22">
              		<input id="radio<%=JspHelper.filterNull( orderId )%>" type="radio" name="notesids" value=<%=JspHelper.filterNull( psMap.get("notesid") )%> class="normalradio" <%=JspHelper.filterNull( strIsChecked)%> onClick="javascript:clickIt('<%=JspHelper.filterNull( psMap.get("notesid") )%>', '<%=JspHelper.filterNull( psMap.get("status") )%>')">
            	</td>
            	<td>&nbsp;<a href="NotesInfo.jsp?<%= OvalTools.randomURL() %>&notesid=<%=JspHelper.filterNull( psMap.get("notesid") )%>&languagecode=<%= strLanguageCode %>" target="down"><%=JspHelper.filterNull( psMap.get("title") )%></a></td>
            	<td>&nbsp;<%=JspHelper.filterNull( psMap.get("fromusername") )%></td>
            	<td>&nbsp;<custom:write name="ps" property="begindate" dataType="date" dataFormatName="dateformat" nbsp="true"/></td>
            	<td>&nbsp;<custom:write name="ps" property="enddate" dataType="date" dataFormatName="dateformat" nbsp="true"/></td>
            	<td>&nbsp;<%=JspHelper.filterNull( psMap.get("statusname") )%></td>
          	</tr>
          	</logic:iterate>
    		<input type="hidden" name="currentid" value="<%=JspHelper.filterNull( nDefaultId )%>">
    		<input type="hidden" name="currentstatus" value="<%=JspHelper.filterNull( nDefaultStatus )%>">
          	<%--------------------------------------  flipping page   --%>
          	<%@ include file="/inc/SummaryAction.inc" %>
      		</table>
    	</td>
  	</tr>
	<tr>
  		<td class="td_center">
  			<a onclick="page_new()"><custom:button type="1" label="L_New" imgsrc="new.gif" border="0" style="width:60"/></a>
  			<a onclick="page_edit()"><custom:button type="1" label="L_Edit" imgsrc="edit.gif" border="0" style="width:60"/></a>
  			<a onclick="page_delete()"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
  			<a onclick="page_stop()"><custom:button type="1" label="L_Stop" imgsrc="stop.gif" border="0" style="width:60"/></a>
  		</td>
	</tr>
	</table>
</form>
</body>
</html>


